package com.example.aidocengine.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
 * 禁用 SpringFox Swagger 的配置
 */
@Configuration
@ConditionalOnProperty(name = "spring.profiles.active", havingValue = "noswagger")
public class NoSwaggerConfig {
    
    /**
     * 创建一个空的 Docket bean 来避免 SpringFox 自动配置
     */
    @Bean
    @Primary
    public Object documentationPluginsBootstrapper() {
        // 返回一个空的对象来阻止 SpringFox 启动
        return new Object();
    }
}